class EmployeeController < ApplicationController

  def index
	@current_employees = Employee.current_employees
	@current_admins = Employee.current_admins
  end
  
  def new
  @employee = Employee.new
  end


def create
    @employee = Employee.new(params[:employee])
    
    if @employee.save
      flash[:notice] = 'Employee profile was successfully created.'
      redirect_to :action => "index"
    else
      render :action => "new"
    end
  end

def show
@employee = Employee.find(params[:id])
end

def edit
@employee = Employee.find(params[:id])
end

def update
    @employee = Employee.find(params[:id])

    if @employee.update_attributes(params[:employee]) 
      flash[:notice] = 'Employee info was updated.'
      redirect_to :action => "show", :id => params[:id]
    else
      render :action => "edit"
end
end

def destroy
@employee = Employee.find(params[:id])
@employee.destroy
flash[:notice] = 'Employee was permanently deleted from the system.'
redirect_to :action => "index"
end
    

end
